<?php ob_start();
include('mysql.php');
$opid=$_POST['opid'];
$mes_text=$_POST['mes_text'];
$class=$_POST['class'];
//echo($opid);
//echo($mes_text);
//echo($class);
$row=mysql_query("SELECT * FROM message where id = (SELECT max(id) FROM message) ");
$back=mysql_fetch_assoc($row);
$maxx=$back['id']+1;
$sql=mysql_query( "INSERT INTO message (id,opid,mes_text,class) VALUES ('$maxx','$opid','$mes_text','$class')");
echo($maxx);

?>